<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8"/>
    <title>window</title>
    <style type="text/css">
        body,input,textarea{font-family:arial,'microsoft yahei';}
        .box{text-align:center;border:solid 1px #ccc;margin:50px 10px;}
        .message{font-weight:bold;margin:60px auto 0px;font-size:20px;}
        .url{margin-bottom:50px;}
        a{text-decoration:underline;color:#0088cc;font-size:14px;}
        @media screen and (max-width: 400px) {
            .box {
                margin:10px 5px;
                border: none;
            }
            .message{
                margin-top: 30px;
            }
            .url{margin-bottom:20px;}
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="message">{{ message }}</div>
        <div class="url">
            {% if is_dialog %}
            <a href="##" onclick="return closeMe();">哟，点击此处关闭~</a>
            {% else %}
            <a href="{{ url }}">哟，点击此处跳转哟~</a>
            {% endif %}
        </div>
    </div>
{% if is_dialog %}
    <script type="text/javascript">
        var layer = typeof(layer) == "undefined" ? parent.layer : top.layer;
        function closeMe(){
            var win = window;
            if(win && win.name){
                var index = layer.getFrameIndex(win.name);
                layer.close(index);
            }
            return false;
        }
        window.onload = function(){
            var win = window;
            setTimeout(function(){
                if(win && win.name){
                    var index = layer.getFrameIndex(win.name);
                    var conf = {
                        width:'330px',
                        height:'150px'
                    };
                    layer.style(index, conf);
                }
            },100);
        };
    </script>
{% endif %}
</body>
</html>
